Pseudo-random number generation based on periodic sampling of one or more linear feedback shift registers

ABSTRACT

One or more methods and systems of generating pseudo-random numbers that are used as encryption keys in cryptographic applications are presented. In one embodiment, a method of generating pseudo-random numbers is performed by sampling output sequences of a linear feedback shift register with a specified periodicity. In one embodiment, the generating of pseudo-random numbers using linear feedback shift registers is accomplished by periodically switching between iterative outputs generated by multiple linear feedback shift registers. In one embodiment, a method of encrypting a pseudo-random number generated by a linear feedback shift register comprises using a nonlinear operator. In one embodiment, a method of further encrypting a pseudo-random number is accomplished by using a hashing function whose initial value varies over time by way of a function operating on one or more variables. In one embodiment, an apparatus for generating pseudo-random numbers using linear feedback shift registers comprises a digital hardware.

RELATED APPLICATIONS

[Not Applicable]

INCORPORATION BY REFERENCE

[Not Applicable]

FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

[Not Applicable]

MICROFICHE/COPYRIGHT REFERENCE

[Not Applicable]

BACKGROUND OF THE INVENTION

Because data, such as human readable data, is readily accessible toindividuals over a public transport media such as the Internet, varioustechniques have been devised to protect unauthorized use of humanreadable data and to insure proper functioning of cryptographicapplications. One or more algorithms may be employed to encrypt the dataprior to its transmission or storage. The encrypted data may be read bythe desired individual(s) by using a corresponding encryption key orseed value. The encryption key may be generated by a pseudo-randomnumber generator (PRNG). If the encryption key is provided only toauthorized parties and if the encryption algorithm is sufficientlycomplex, unauthorized access may be prevented. Often, however, theencryption key may be deciphered by a hacker or cryptanalyst.

One drawback in generating secure encryption keys relates to thestatistical properties of the pseudo-random number generator (PRNG).Often enough, the generated key space is too small allowing acryptanalyst to successfully determine an appropriate key using one ormore search algorithms.

Another drawback relates to the relative ease in determining anencryption key based on deciphering one or more parameters of analgorithm. For example, a cryptanalyst may often find it easier toexamine the smaller space of algorithm parameters. Often, one or moreinternal parameters may be deciphered and used to formulate thealgorithm. Many key encryption algorithms are prone to being easilydeciphered by a cryptanalyst's observation of the behavior of one ormore internal parameters. For example, a periodic occurrence of aparticular outcome within a sample space may allow a cryptanalyst todecode one or more parameters contributory to the design of thealgorithm.

Another area of concern relates to the difficulty required inimplementing a desirably secure PRNG. Because of its simplicity, PRNGsare often implemented using linear feedback shift registers (LFSRs);however, such implementations are very vulnerable to attack. Directapplication of a LFSR to generate pseudo-random numbers would implementan algorithm that is vulnerable to attack.

Further limitations and disadvantages of conventional and traditionalapproaches will become apparent to one of skill in the art, throughcomparison of such systems with some aspects of the present invention asset forth in the remainder of the present application with reference tothe drawings.

BRIEF SUMMARY OF THE INVENTION

Aspects of the invention provide for a method, system and/or apparatusto generate pseudo-random numbers that are used as encryption keys orseed values in cryptographic applications. The pseudo-random numbergenerator (PRNG) is implemented using one or more linear feedback shiftregisters (LFSR) that employ a number of techniques to conceal thebehavior of its internal parameters.

In one embodiment, a method of generating pseudo-random numbers isperformed by sampling output sequences of a linear feedback shiftregister with a specified periodicity. In one embodiment, the linearfeedback shift register generates said output sequences corresponding tomaximal length sequences. In one embodiment, the specified periodicityis equal to the number of bits output by said linear feedback shiftregister.

In one embodiment, a generating of pseudo-random numbers using linearfeedback shift registers in which the correlation between successivepseudo-random numbers is reduced, is accomplished by periodicallyswitching between iterative outputs generated by at least a first linearfeedback shift register and iterative outputs generated by at least asecond linear feedback shift register.

In one embodiment, a method of encrypting a pseudo-random numbergenerated by a linear feedback shift register comprises using anonlinear operator to operate on the pseudo-random number and one ormore operands. The nonlinear operator may comprise an XOR function. Inanother embodiment, the one or more operands comprise a unique bitsequence corresponding to the LFSR currently used to generate thepseudo-random number.

In one embodiment, a method of further encrypting a pseudo-random numbergenerated from a linear feedback shift register by using a hashingfunction is accomplished by receiving the pseudo-random number generatedfrom the linear feedback shift register and varying the initial value ofthe hashing function over time by way of a function operating on one ormore variables. The one or more variables may comprise, for example, aconfiguration of feedback taps associated with the linear feedback shiftregister used to generate the pseudo-random number.

In one embodiment, an apparatus for generating pseudo-random numbersusing linear feedback shift registers comprises a digital hardware. Inone embodiment, the digital hardware comprises flip-flops and gates.

These and other advantages, aspects, and novel features of the presentinvention, as well as details of illustrated embodiments, thereof, willbe more fully understood from the following description and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates outputs corresponding to an exemplary 3 bit linearfeedback shift register (LFSR) in accordance with an embodiment of theinvention.

FIG. 2 illustrates a functional block diagram of a system used togenerate the encryption key outputs shown in FIG. 1 in accordance withan embodiment of the invention.

FIG. 3 illustrates outputs of a PRNG corresponding to an exemplary n=3bit linear feedback shift register (LFSR), in which the LFSR outputs aresampled every n=3 iterations in accordance with an embodiment of theinvention.

FIG. 4 illustrates outputs of a PRNG employing periodic switchingbetween outputs of at least a first LFSR to outputs of at least a secondLFSR in accordance with an embodiment of the invention.

FIG. 5 illustrates an operational flow diagram of a PRNG thatincorporates the techniques previously described in accordance with anembodiment of the invention.

FIG. 6 illustrates a functional block diagram of a typical hashfunction, h, used to further encrypt a pseudo-random number inaccordance with an embodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

Aspects of the present invention may be found in a system and method togenerate pseudo-random numbers that are used as encryption keys or seedvalues in cryptographic applications. The pseudo-random number generator(PRNG) is implemented using one or more linear feedback shift registers(LFSR) that employ a number of techniques to conceal the behavior of itsinternal parameters or its underlying algorithm. In one embodiment, theoutputs of an LFSR are sampled periodically, instead of consecutively atthe next iteration, to determine the encryption keys used in thecryptographic application. In one embodiment, the one or more distinctLFSRs are switched periodically after a number of iterations, whereineach of the one or more distinct LFSRs is differentiated by a unique setof feedback parameters or taps. In one embodiment, nonlinear operatorsare used to map encryption keys generated by a LFSRs to outputs to makeit more difficult for a cryptanalyst to decipher the algorithm used inthe encryption process. In one embodiment, the configuration of thefeedback parameters or taps of a LFSRs are used to determine the initialvalue of a hashing function used to further encrypt the output generatedby the LFSR.

FIG. 1 illustrates encryption key outputs corresponding to an exemplarylinear feedback shift register (LFSR) in which the LFSR generates athree bit output (n=3) in accordance with an embodiment of theinvention. As illustrated there are a total of seven different outputscorresponding to iterations 1 through 7 for this 3 bit LFSR. Note thatan initial value of (111) is used to generate the table and that theconfiguration shown provides a maximal length sequence, havingperiodicity, 7. A LFSR of any given size n (corresponding to the numberof registers in the LFSR) is capable of producing every possible state(except the all zero state) during the period p=2^(n)−1, but will do soonly if one or more feedback taps are properly configured, as will bediscussed shortly.

FIG. 2 illustrates a functional block diagram of a system used togenerate the encryption key outputs shown in FIG. 1 in accordance withan embodiment of the invention. In the embodiment shown, the LFSRoutputs (X₂X₁X₀) are binary digits generated from an n stage LFSR 204,in which n=3 for example. As shown, the LFSR 204 utilizes feedback taps208 originating at bit 0 (least significant bit, LSB) and at bit 1 (nextsignificant bit), in which the bit ordering is from a least significantbit, LSB (X₀) to a most significant bit, MSB, X₂. The feedback taps maybe designated by way of a triplet P_(I)=(P₂, P₁, P₀), which in thisembodiment equals (0, 1, 1). The feedback taps 208 are modulo-2 summedby an exemplary summing device 212 and the sum is fed back to the inputof the register corresponding to the MSB, X₂. An implementation of thefunctional block diagram of FIG. 2 may be easily implemented by way ofdigital hardware. In one embodiment, the hardware may comprise one ormore exemplary flip-flops and gates. The gates may be configured toimplement an appropriate feedback tap configuration for the LFSR 204.

The popularity of using a LFSR to implement a PRNG is due in part to itsrelatively simple implementation and with the right choice of feedbacktaps, the outputs may generate a maximal length sequence, having outputscharacterized by periodicity, p=2^(n)−1, where the value n correspondsto the number of registers or the number of bits generated by the LFSR.However, by examining the structure of a LFSR, one may demonstrate anobvious potential problem with its use in providing secure applications.It may be easily discerned by examining consecutive outputs of a LFSRthat the MSB of each output is a binary-weighted modulo-2 sum of thefeedback taps and the remaining bits are computed by simply shifting theprevious encryption key to the right by one bit.

A cryptanalyst may easily identify that the algorithm is implemented bya LFSR by simple observation of the outputs shown in FIG. 1. An analysisof possible feedback taps using assistance provided by past keyencryption values may easily compromise the structure of the feedbacktaps.

FIG. 3 illustrates outputs of a PRNG corresponding to an exemplary n=3bit linear feedback shift register (LFSR), in which the LFSR outputs aresampled every n=3 iterations in accordance with an embodiment of theinvention. The results of periodic sampling every n iterations isillustrated in FIG. 3, in which the LFSR shown in FIG. 1 is used and theiterations commence from an initial starting value of (111). As one maysee, the use of periodic sampling reduces the correlation betweenconsecutive or successive outputs of an LFSR.

There are advantages to sampling the LFSR output sequence withperiodicity equal to n=3. If an n-bit LFSR is sampled once every niterations then the maximal length properties of its output sequencewill be preserved. In addition, sampling once every n iterationsprevents revealing the underlying shifting of bits of an LFSR structure,since all n bits related to an encryption key will be processed beforethe next encryption key is generated. Note that the simplisticimplementation of the underlying LFSR is preserved while periodicsampling of the LFSR outputs reduces a cryptanalyst's ability tocorrelate outputs between consecutive iterations. Although FIG. 3provides an embodiment of a 3 bit LFSR implementation in which outputsare sampled every 3 iterations, it is contemplated that otherembodiments may be implemented using a n bit LFSR where n≠3, in whichthe output sequence is sampled every n iterations. It is furthercontemplated that other embodiments may be implemented using an n bitLFSR, in which the output sequence may be sampled with period L, forwhich L≠n.

FIG. 4 illustrates outputs of a PRNG employing periodic switchingbetween iterative outputs generated by at least a first LFSR anditerative outputs generated by at least a second LFSR in accordance withan embodiment of the invention. The switching is performed after aspecified number of iterations. In embodiments with multiple LFSRs, theswitching is performed sequentially from one LFSR to the next as will bedescribed later in FIG. 5. Referring to the table shown in FIG. 4, theembodiment illustrates switching performed between two exemplary LFSRs.The first LFSR corresponds to the implementation illustrated andpreviously described in FIG. 2. The second LFSR corresponds to a LFSRhaving feedback taps at bit 0 (LSB) and bit 2 (MSB). For the secondLFSR, the feedback taps, again, are modulo-2 summed and fed back to theinput of the register corresponding to the MSB, X₂. In addition to theperiodic sampling technique described in the embodiment of FIG. 3, theswitching technique shown in the embodiment of FIG. 4 may foil ahacker's attempts to search the sample space of possible parameter tapsof an LFSR. Because, the sample space of parameter taps is often smallerthan that corresponding to the sample space of possible encryption keys,a hacker or cryptanalyst may pose a threat if he possesses knowledge ofsome of the parameters taps or encryption keys. Referring to FIG. 4, asimple method to further thwart a cryptanalyst is to continuously switchbetween LFSRs so that a hacker will be unable to determine an algorithm(that is easily discernible when using a single LFSR). By carefullyswitching between one or more LFSRs, each configured using M distinctsets of feedback taps, it may be possible to obtain an overall combinedoutput sequence that is periodic with period M*(2^(n)−1). The resultingsequence would also have a distribution that is nearly white (or nearrandom) if all the possible values, except the all zero sequence (000),are generated in one period. One configures the M different sets offeedback taps such that each LFSR generates a maximal length sequence,thereby assuring that the output over all LFSRs comprises a nearly whitesequence. The only other requirement is that a complete period over theentire set of LFSRs is traversed once and only once every M*(2^(n)−1)iterations. There are many ways to accomplish this, but a simpleimplementation might be to switch from a LFSR (characterized by distinctsets of feedback taps) when a fixed number of iterations is reached; atthe same time, store a current state value for the LFSR. The storedstate value may be recalled when the algorithm switches back to theLFSR, allowing the LFSR to proceed to the next logical state. The tableof FIG. 4 shows an example of periodic switching between an exemplaryM=2 different LFSRs in which the switching is done after everyiteration. In fact, the switching may mislead a potential hacker tobelieve that an algorithm other than LFSRs is being used. Referring toFIG. 4, note that the same key may be re-generated after X iterationswhere X<2^(n)−1; however, the pseudo-random number sequence is notperiodic with period p=X. This may be seen in Table 3 by noting that thevalue 100 is generated on iterations 2 and 5; however, the PRNG hasperiod 2*7=14, and is not periodic with period 3. Again, the use ofperiodic switching among one or more LFSRs reduces the correlationbetween consecutive or successive outputs of an LFSR.

The behavior of the LFSRs may be further concealed by applying anonlinear operator such as an exemplary XOR operator to thepseudo-random number generated by the techniques described in FIGS. 3and 4. In reference to the LFSR switching technique described in FIG. 4,the pseudo-random number may be XORed with a different operand or binarysequence corresponding to each LFSR used. For example, if a 3 bit LFSRis used, a first distinct 3 bit binary number such as (0, 1, 1) may beused as the operand for a first LFSR while a second distinct 3 bitbinary number such as (1, 0, 1) may be used as the operand for a secondLFSR. If the nonlinear operators are carefully chosen to map every inputvalue to a different output value, then the nearly white distribution ofthe input to the nonlinear operator will be preserved at its output.

FIG. 5 illustrates an operational flow diagram of a PRNG thatincorporates the techniques previously described in accordance with anembodiment of the invention. Pseudo-random numbers may be generated byperiodically sampling M distinct LFSRs, in which switching from one LFSRto the next LFSR is performed after every R iterations of each LFSR.Further, each LFSR may generate an output, K_(I), by way of samplingevery L_(I) iterations. In addition, a nonlinear operator, F_(I) may beapplied that is unique to the LFSR being used in order to generate afinal pseudo-random number, K_(I)′. By way of choosing appropriatefeedback tap parameters to insure the maximal length property for eachof the LFSRs employed, the pseudo-random numbers generated by this PRNGwill have nearly white noise characteristics. The PRNG will becharacterized by a periodicity of M*(2^(n)−1) where n is the number ofbits as shown in the following table of variables:

Variables I Placeholder or counter to determine which LFSR is being usedJ Placeholder for the number of iterations that have been generated witha particular LFSR (used as a counter to determine when switching to nextLFSR should occur) LFSR (L_(I), P_(I), S_(I)) The result of periodicsampling (L_(I) samples) of an LFSR starting from a state of S_(I) andusing feedback taps P_(I) M Number of different LFSRs L₀, . . . ,L_(M−1) Sampling period (no. of iterations before the output is sampled)for the Ith LFSR P₀, . . . , P_(M−1) The feedback taps for the Ith LFSRF₀, . . . , F_(M−1) Nonlinear operator for the Ith LFSR S₀, . . . ,S_(M−1) Current state for the Ith LFSR R Number of iterations beforeswitching to next LFSR K_(I) Pseudo-random number K_(I)′ FinalPseudo-random number

Referring to FIG. 5, at step 504, a first of M LFSRs generates apseudo-random number, K_(I), as a function of the sampling period of theIth LFSR, the configuration of feedback taps for the Ith LFSR, and thecurrent state of the Ith LFSR. The values for the placeholders (orcounters), I, and J, are initialized to zero. Next, at step 508, the newstate is saved as the current state, i.e., S_(I)=K_(I). At step 512, anon-linear operator, F_(I), is applied to the operand, the pseudo-randomnumber, K_(I), to generate K_(I)′. Next, at step 516, the placeholder Jis evaluated to determine whether the next LFSR should be used. If J isequal to the value (R−1), then the LFSR is switched as indicated at step524. Otherwise, at step 520, J is incremented by one and the nextpseudo-random number is generated. At step 524, the LFSR is switched tothe LFSR designated by I=(I+1)Mod M while the placeholder J is reset tozero.

FIG. 6 illustrates a functional block diagram of a typical hash (orhashing) function, h, used to further encrypt a pseudo-random number inaccordance with an embodiment of the invention. As illustrated, theoutput of the PRNG can be used as the hash input, x. The hash input, x,is of arbitrary finite length and can be divided into fixed-length r-bitblocks x_(i) for which i=1, . . . , t. This preprocessing, occurring ata preprocessor 604, typically involves appending extra bits (padding) asnecessary to attain an overall bit length which is a multiple of theblock length r and/or including a block or partial block indicating thebit length of the unpadded input. An internal fixed-size hash functionor compression function, f, 608 may be used to compute H_(i), a newintermediate result having bit length, n′, for example, as a function ofthe previous n′ bit intermediate result (H_(i−1)) and the input blockx_(i). The general process of an iterated hash function is shown in FIG.6 in which the input x={x₁, x₂, . . . , x_(t)}. The hashing function maybe represented mathematically as follows:H ₀ =IV; H _(i) =f(H _(i−1) , X _(i)), 1≦i≦t, h(x)=g(Ht).

H_(i−1) serves as the n′-bit chaining variable between stage i−1 andstage i, while H₀ is a pre-defined starting value or initializing value(IV). An optional output transformation function, g, 612 may be used asa final step to map the n′-bit chaining variable to an m-bit resultg(H_(t)).

The use of a hashing function for scrambling is well known; however, theinitial value of the hashing function (IV) is often a constant value. Asimple method to add a time varying element to the hashing function inorder to further conceal the hashing function (or underlying algorithmused) is to make the hashing function dependent upon the configurationof the feedback taps of the LFSR used by the PRNG in generating aparticular pseudo-random number. For example, the initial value (IV) maybe computed as a function, w, operating on a variable such as theconfiguration of the feedback taps P_(I), of its associated LFSR, i.e.IV=w(P_(I)). The configuration of the feedback taps may vary over time,for example, when periodic LFSR switching is performed. As aconsequence, the initial value (IV) of the hashing function will varyover time and will depend on the LFSR currently used. It is contemplatedthat the function w may be a function that operates on other variablessuch as the iteration number or current output state of a LFSR.

While the invention has been described with reference to certainembodiments, it will be understood by those skilled in the art thatvarious changes may be made and equivalents may be substituted withoutdeparting from the scope of the invention. In addition, manymodifications may be made to adapt a particular situation or material tothe teachings of the invention without departing from its scope.Therefore, it is intended that the invention not be limited to theparticular embodiment disclosed, but that the invention will include allembodiments falling within the scope of the appended claims.

1. A method of generating pseudo-random numbers using linear feedback shift registers in which the correlation between successive pseudo-random numbers is reduced, said method comprising periodically switching between iterative outputs generated by at least a first linear feedback shift register and iterative outputs generated by at least a second linear feedback shift register.
 2. The method of claim 1 wherein said pseudo-random numbers are generated with a period equal to the sum of each of the individual linear feedback shift register periods.
 3. The method of claim 2 wherein said pseudo-random numbers are generated with a period equal to the sum of each of the individual linear feedback shift register periods.
 4. The method of claim 2 wherein said pseudo-random numbers are generated with a period equal to the sum of each of the individual linear feedback shift register periods.
 5. The method of claim 1 further comprising: receiving said pseudo-random number generated from said linear feedback shift register; and varying the initial value of said hashing function over time by way of a function operating on one or more variables.
 6. The method of claim 5 wherein said one or more variables comprises the configuration of feedback taps associated with said linear feedback shift register.
 7. A method of further encrypting a pseudo-random number generated from a linear feedback shift register by using a hashing function comprising: receiving said pseudo-random number generated from said linear feedback shift register; and varying the initial value of said hashing function over time by way of a function operating on one or more variables. 